<template>
  <div class="field-time">
    <el-time-picker
      :value-format="format"
      :picker-options="{
        format: format
      }"
      :size="size"
      v-model="localValue"
      :disabled="disabled || readOnly"
    >
    </el-time-picker>
  </div>
</template>

<script>
import Mixins from "./mixins";
export default {
  mixins: [Mixins],
  computed: {
    format: function() {
      let format = "HH:mm:ss";
      if (this.tableField.fieldVariableValue) {
        //1精确到秒，2精确到分，3精确到时
        if (this.tableField.fieldVariableValue.accuracy === 2) {
          format = "HH:mm";
        } else if (this.tableField.fieldVariableValue.accuracy === 3) {
          format = "HH";
        }
      }
      return format;
    }
  }
};
</script>

<style></style>